package com.catal.util;

import org.springframework.context.ApplicationContext;
import org.springframework.context.support.ClassPathXmlApplicationContext;
import org.springframework.jdbc.core.support.JdbcDaoSupport;

import com.catal.framework.dao.impl.JdbcDaoImpl;

public class BeanUtilFactory {
	private static ApplicationContext ctx = new ClassPathXmlApplicationContext(
	"classpath*:/conf/*.spring.xml");

	public static JdbcDaoSupport getDaoBean(String beanName){
		return (JdbcDaoSupport) ctx.getBean(beanName);
	}
	
	public static JdbcDaoImpl getJdbcDaoImpl(String beanName){
		return (JdbcDaoImpl) ctx.getBean(beanName);
	}
}
